<template>
  <view class="page-wrap">
    <u-navbar :is-back="false" title-color="#fff" :title-bold="true" :background="background">
      <view class="top-handler" v-if="login_user_info">
        <view class="handler_image" @click="actionSheet">
          <view class="top_imgon">
            <text class="cuIcon-home text-blue"></text>
          </view>
          <view class="top_img">
            <text class="cuIcon-triangledownfill text-blue"></text>
          </view>
        </view>

        <view class="handler">
          {{title||''}}
        </view>
        <view>...</view>
      </view>
    </u-navbar>

    <view class="content_All">
      <view class="message">
        <view class="message_hander">
          <view class="message_left">
            <image src="../../static/img/pb.jpg" mode=""></image>
            <view>{{personage.store_name}}</view>
          </view>
          <view class="message_right">
            <view class="message_xright">
              <text class="cuIcon-settingsfill text-blue"></text>
            </view>
            <view class="message_cut" @click="showAction=!showAction">设置</view>
          </view>
        </view>
      </view>
      <view class="classify">
        <view class="classify_item">
          <image src="../../static/img/240 (2).png" mode=""></image>
          <view class="" class="classify_num">{{member}}</view>
          <view class="classify_amount">会员<br />总数</view>
        </view>
        <view class="classify_item">
          <image src="../../static/img/240 (3).png" mode=""></image>
          <view class="" class="classify_num">{{fitnessNum}}</view>
          <view class="classify_amount">健康<br />测评</view>
        </view>
        <view class="classify_item">
          <image src="../../static/img/240 (5).png" mode=""></image>
          <view class="" class="classify_num">{{regulateNum}}</view>
          <view class="classify_amount">调理<br />方案</view>
        </view>
        <view class="classify_item">
          <image src="../../static/img/240 (4).png" mode=""></image>
          <view class="" class="classify_num">{{implementNum}}</view>
          <view class="classify_amount">门店<br />服务</view>
        </view>

        <!-- <view class="classify_item">
					<image src="../../static/img/touzi.png" mode=""></image>
					<view class="" class="classify_num">{{topay}}</view>
					<view class="classify_amount">投资<br />损益</view>
				</view> -->
      </view>



      <view class="investment">
        <view class="shop_name">健康管理效益：</view>
        <view class="shop_name">{{topay}}元</view>
      </view>



      <view class="shopmanage" v-if="storeManageMenus&&storeManageMenus.length>0">
        <view class="shop_name">店铺管理</view>
        <view class="shop_content">
          <view class="shop_item" v-for="(item,index) in storeManageMenus" :key="index"
            @click="clickMenu(item.service)">
            <image class="image" :src="getImagePath(item.app_icon,true)" mode="">
            </image>
            <view class="item_name">{{item.menu_name}}</view>
          </view>
        </view>
      </view>
      <!--   <view class="shopmanage"
        v-else-if="userRoles&&userRoles.length>0&&(userRoles.includes('fyzh_md_dzh')||userRoles.includes('fyzh_md_jingli'))">
        <view class="shop_name">店铺管理</view>
        <view class="shop_content">
          <view class="shop_item" v-for="(item,index) in memberManageMenus" :key="index"
            @click="clickMenu(item.service)">
            <image class="image" :src="getImagePath(item.app_icon,true)" mode="">
            </image>
            <view class="item_name">{{item.menu_name}}</view>
          </view>
        </view>
      </view> -->
      <view class="shopmanage" v-if="userManageMenus.length>0">
        <view class="shop_name">用户管理</view>
        <view class="shop_content">
          <view class="shop_item" v-for="(item,index) in userManageMenus" :key="index" @click="clickMenu(item.service)">
            <image class="image" :src="getImagePath(item.app_icon)" mode="">
            </image>
            <view class="item_name">{{item.menu_name}}</view>
          </view>
        </view>
      </view>
      <view class="shopmanage">
        <u-search placeholder="请输入手机号搜索用户" v-model="userPhoneForSearch" @search="onSearch" @custom="onSearch"
          @clear="clearKeywords()"></u-search>
        <template v-if="preciseUserInfoList&&preciseUserInfoList.length>0">
          <view class="user-box-list" v-for="item in preciseUserInfoList">
            <view class="user-info-box">
              <view class="user-image">
                <image class="image" :src="getImagePath(item.hy_profile_url,true)" mode="" v-if="item.hy_profile_url">
                </image>
              </view>
              <view class="user-info">
                <view class="form-item">
                  <view class="label">
                    会员号:
                  </view>
                  <view class="value">
                    {{item.hy_no||''}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    姓名:
                  </view>
                  <view class="value">
                    {{item.hy_name||''}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    联系电话:
                  </view>
                  <view class="value">
                    {{item.phone||''}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    客户标签:
                  </view>
                  <view class="value">
                    {{item.customer_tag||''}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    专属健管师:
                  </view>
                  <view class="value">
                    {{item.nutrilite_tube_division||''}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    本月评测次数:
                  </view>
                  <view class="value">
                    {{item.interveneNum||'0'}}
                  </view>
                </view>
                <view class="form-item">
                  <view class="label">
                    本月干预次数:
                  </view>
                  <view class="value">
                    {{item.reviewNum||'0'}}
                  </view>
                </view>
              </view>
            </view>
            <view class="user-menu-box" v-if="item">
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('khxx',item)">客户信息</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('jksj',item)">健康数据</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('pcbg',item)">评测报告</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('jkfa',item)">健康方案</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('gyjl',item)">干预记录</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('hfjl',item)">回访记录</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('tzsy',item)">投资损益</button>
              <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('tlxg',item)">调理效果</button>
            </view>
          </view>
        </template>

        <view class="user-box-list" v-else-if="preciseUserInfo">
          <view class="user-info-box">
            <view class="user-image">
              <image class="image" :src="getImagePath(preciseUserInfo.hy_profile_url,true)" mode=""
                v-if="preciseUserInfo.hy_profile_url"></image>
            </view>
            <view class="user-info">
              <view class="form-item">
                <view class="label">
                  会员号:
                </view>
                <view class="value">
                  {{preciseUserInfo.hy_no||''}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  姓名:
                </view>
                <view class="value">
                  {{preciseUserInfo.hy_name||''}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  联系电话:
                </view>
                <view class="value">
                  {{preciseUserInfo.phone||''}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  客户标签:
                </view>
                <view class="value">
                  {{preciseUserInfo.customer_tag||''}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  专属健管师:
                </view>
                <view class="value">
                  {{preciseUserInfo.nutrilite_tube_division||''}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  本月评测次数:
                </view>
                <view class="value">
                  {{preciseUserInfo.interveneNum||'0'}}
                </view>
              </view>
              <view class="form-item">
                <view class="label">
                  本月干预次数:
                </view>
                <view class="value">
                  {{preciseUserInfo.reviewNum||'0'}}
                </view>
              </view>

            </view>
            <!-- bx-list ref="bxList" serviceName="srvstore_member_mgmt_select" srvApp="fyzhmd"
                :condition="userCondition" v-if="userCondition" :pageType="'list'" :listType="'list'" :showTab="false"
                :showButton="true" :fixed="false" :showFootBtn="showFootBtn" @click-list-item="clickItem"
                @list-change="listChange" @clickFootBtn="clickFootBtn" @loadEnd="loadEnd"
                v-if="listConfig&&listConfig.srv_cols">
                </bx-list> -->
          </view>
          <view class="user-menu-box" v-if="preciseUserInfo">
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('khxx')">客户信息</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('jksj')">健康数据</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('pcbg')">评测报告</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('jkfa')">健康方案</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('gyjl')">干预记录</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('hfjl')">回访记录</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('tzsy')">投资损益</button>
            <button class="cu-btn bg-blue sm shadow-blur" @click="clickUserMenu('tlxg')">调理效果</button>
          </view>

        </view>

      </view>

      <view class="fitness" v-if="dataCollectMenus.length>0">
        <view class="shop_name">数据采集</view>
        <view class="shop_content">
          <view class="shop_item" v-for="(item,index) in dataCollectMenus" :key="index"
            @click="clickMenu(item.service)">
            <image class="image" :src="getImagePath(item.app_icon)" mode="">
            </image>
            <view class="item_name">{{item.menu_name}}</view>
          </view>
        </view>
      </view>


      <view class="fitness" v-if="healthManageMenus.length>0">
        <view class="shop_name">健康管理</view>
        <view class="shop_content">
          <view class="shop_item" v-for="(item,index) in healthManageMenus" :key="index"
            @click="clickMenu(item.service)">
            <image class="image" :src="getImagePath(item.app_icon)" mode="">
            </image>
            <view class="item_name">{{item.menu_name}}</view>
          </view>
        </view>
      </view>
    </view>

    <view class="app-list" v-if="appList.length&&appList.length>0&&appList.length<=10">
      <view class="app-item" :class="{current:currentApp.name === item.name}" v-for="(item,aindex) in appList"
        @click="clickApp(item,aindex)">
        <view class="icon" v-if="item.icon">
          <image class="image" :src="'https://login.100xsys.cn/main/'+item.icon" mode="aspectFit">
          </image>
        </view>
        <view class="icon shadow-blur bg-blue" v-else-if="item.title">
          <view class="text" v-for="text in item.title.slice(0,4).split('')">
            {{text}}
          </view>
        </view>
        <view class="icon" v-else>
          <text class="cuIcon-question"></text>
        </view>
        <view class="label">
          {{item.title}}
        </view>
      </view>
    </view>

    <u-action-sheet :list="[...actionList,versionText]" v-model="showAction" @click="clickAction">
    </u-action-sheet>
    <u-popup v-model="showSwitchUser" mode="center" width="90%" border-radius="10">
      <view class="head-handler-popup">
        <view class="tips">
          请选择要切换的账号
        </view>
        <view class="app-list" v-if="showSwitchUser&&authorized_users&&authorized_users.length>0">
          <view class="app-item long light cu-btn bg-blue" v-for="(user,aIndex) in authorized_users"
            @click="confirmSwitchUser(user)">
            {{user.authorized_user_name||''}}
          </view>
        </view>
      </view>
    </u-popup>

    <u-popup v-model="showSwitchShop" mode='bottom'>
      <view class="head-handler-popup">
        <view class="tips">
          请选择要切换的店铺
        </view>
        <view class="" v-if="storelist&&storelist.length>0">
          <button class="shopList" v-for="(user,aIndex) in storelist" @click="confirmSwitchShop(user)"
            :class="(!isPresent&&aIndex===0)||isPresent==user.id?'present':''">
            {{user.store_name||''}}
          </button>
        </view>
      </view>
    </u-popup>

    <u-alert-tips :show="ErrShow" type="error" @close="ErrShow = false" :title="ErrTile" :close-able="true">
    </u-alert-tips>

  </view>
</template>

<script>
  // 店铺管理
  const storeManageMenus = [{
      menu_name: "门店管理",
      app_icon: '../../static/img/mdgl.png',
      service: "srvstore_shop_mgmt_select"
    },
    {
      menu_name: "门店员工",
      app_icon: '../../static/img/mdyg.png',
      service: "srvstore_shop_staff_role_mgmt_select"
    },
    {
      menu_name: "内容管理",
      app_icon: '../../static/img/nrgl.png',
      service: ""
    },
    {
      menu_name: "设备管理",
      app_icon: '../../static/img/sbgl.png',
      service: "srvstore_health_equipment_management_select"
    }
  ]


  // 用户管理
  const userManageMenus = [{
      menu_name: "新增用户",
      app_icon: '../../static/img/xzyh.png',
      service: "srvstore_member_mgmt_add"
    },
    {
      menu_name: "用户管理",
      app_icon: '../../static/img/yhgl.png',
      service: "srvstore_member_mgmt_select"
    }
  ]

  // 健康管理
  const healthManageMenus = [{
      menu_name: "评估报告",
      app_icon: '../../static/img/pcbg.png',
      service: "srvstore_evaluation_report_select"
    },
    {
      menu_name: "健康方案",
      app_icon: '../../static/img/jkfa.png',
      service: "srvfyzh_health_programme_select"
    },
    {
      menu_name: "实施干预",
      app_icon: '../../static/img/ssgy.png',
      service: "srvfyzh_health_tonning_record_select"
    },
    {
      menu_name: "顾客回访",
      app_icon: '../../static/img/gkhf.png',
      service: "srvstore_visit_to_record_select"
    },
    {
      menu_name: "用药划价",
      app_icon: '../../static/img/yyhj.png',
      service: "srvfyzh_health_medicine_accurately_select"
    },
  ]


  // 数据采集
  const dataCollectMenus = [{
      menu_name: "体质量测",
      app_icon: '../../static/img/tzlc.png',
      service: "srvstore_quality_measurement_select"
    },
    {
      menu_name: "风险评估",
      app_icon: '../../static/img/fxpg.png',
      service: "srvstore_health_body_exam_select"
    },
    {
      menu_name: "血压数据",
      app_icon: '../../static/img/xysj.png',
      service: "srvstore_health_user_blood_pressure_select"
    },
    {
      menu_name: "血糖数据",
      app_icon: '../../static/img/xtsj.png',
      service: "srvstore_health_user_blood_sugar_select"
    }

  ]
  export default {
    // components: {
    //   menuBox
    // },
    data() {
      return {
        // 按钮组
        // storeManageMenus: storeManageMenus, //店铺管理按钮
        // memberManageMenus: memberManageMenus, //店铺员工管理按钮
        // userManageMenus: userManageMenus, //用户管理按钮
        // rootUserManageMenus: rootUserManageMenus, //枫叶正红管理员用户管理按钮
        // healthManageMenus: healthManageMenus, //健康管理按钮
        dataCollectMenus: dataCollectMenus, //数据采集按钮
        preciseUserInfoList: [],
        userPhoneForSearch: "", //用来精确搜索用户的手机号
        preciseUserInfo: null, //精确搜索到的用户信息
        storeNo: "",
        syslist: [],
        healthList: [],
        ErrTile: '当前用户没有任何店铺,请退出登录。',
        ErrShow: false,
        storelist: [],
        isPresent: 0,
        background: {
          backgroundColor: 'rgba(237, 237, 237, 1)',
          // backgroundColor: '#0055FF',
          // 导航栏背景图
          // background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
          // 还可以设置背景图size属性
          // backgroundSize: 'cover',
          // 渐变色
          // backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
        },
        title: "枫叶正红门店",
        appList: [],
        current: 0,
        showMenu: true,
        menuList: [],
        showHandlerAction: false,
        showHandlerPopup: false,
        showSwitchShop: false,
        showSwitchUser: false,
        tips: {
          text: '在水一方',
          color: '#909399',
          fontSize: 24
        },
        appHandler: [{
          text: "热加载"
        }],
        actionList: [{
          text: '修改密码',
          // color: 'blue',
          // subText: '感谢您的点赞'
        }, {
          text: '刷新页面'
        }, {
          text: '退出登录'
        }, {
          text: '切换用户'
        }],
        showAction: false,
        versionText: {
          text: "版本号:220124"
        },
        versionNo: "0.1.220124",
        member: 0,
        fitnessNum: 0,
        regulateNum: 0,
        implementNum: 0,
        topay: 0,
        personage: {},
        hyInfo: {}
      }
    },
    watch: {
      login_user_info: {
        immediate: true,
        handler(newValue, oldValue) {
          if (newValue && Array.isArray(newValue.roles) && newValue.roles.includes('admin')) {
            if (!this.actionList.find(item => item.text === '热加载')) {
              this.actionList.unshift({
                text: '热加载'
              })
            }
          }
        }
      }
    },
    computed: {
      healthManageMenus() {
        let userRoles = uni.getStorageSync('login_user_info').roles;
        if (!Array.isArray(userRoles) || userRoles.length == 0) {
          return []
        }
        return healthManageMenus.filter(item => {
          if (userRoles.includes('fyzh_mgr') || userRoles.includes('fyzh_md_yishi') || userRoles.includes(
              'app_fyzhmd_biz_develop') || userRoles.includes('app_fyzhmd_admin')) {
            return true
            // 'fyzh_md_yishi','app_fyzhmd_biz_develop','app_fyzhmd_admin','fyzh_mgr'
          } else if (item.menu_name === '顾客回访') {
            // 如果当前用户角色 是 推广员， 经理， 店长时，不显示顾客回访
            if (userRoles.includes('fyzh_md_tuiguangyuan') || userRoles.includes(
                'fyzh_md_jingli') || userRoles.includes('fyzh_md_dzh')) {
              return false
            }
          } else if (item.menu_name === '用药划价') {
            // 用药划价 只有当前用户的角色是 健管师/店员/推广员 时，不显示用药划价。 其他角色显示
            if (userRoles.includes('fyzh_md_tuiguangyuan') || userRoles.includes(
                'fyzh_md_jianguanshi') || userRoles.includes('fyzh_md_dianyuan')) {
              return false
            }
          }
          return true
        })
      },
      userManageMenus() {
        let userRoles = uni.getStorageSync('login_user_info').roles;
        if (!Array.isArray(userRoles) || userRoles.length == 0) {
          return []
        }
        if (userRoles.includes('fyzh_mgr')) {
          return userManageMenus
        }
        return userManageMenus.filter(item => item.menu_name === '用户管理')
      },
      storeManageMenus() {

        let userRoles = uni.getStorageSync('login_user_info').roles;
        if (!Array.isArray(userRoles)) {
          return []
        }

        return storeManageMenus.filter(item => {
          if (userRoles && userRoles.length > 0) {
            // 门店管理按钮组汇总    管理员展示所有 ，   店长和经理，展示  员工管理
            if (userRoles.includes('fyzh_mgr')) {
              return true
            } else if (userRoles.includes('fyzh_md_dzh') || userRoles.includes('fyzh_md_jingli')) {
              if (item.menu_name === '门店员工') {
                return true
              }
            } else if (userRoles.includes('fyzh_md_dianyuan') || userRoles.includes('fyzh_md_jianguanshi')) {
              // 店员和健管师不展示店铺管理
              return false
            }
          }
        })
      },
      userCondition() {
        // 精确搜索用户的条件
        if (this.userPhoneForSearch) {
          return [{
            colName: 'phone',
            ruleType: 'eq',
            value: this.userPhoneForSearch
          }]
        } else {
          return false
        }

      },
      userRoles() {
        return this.login_user_info?.roles || []
      },
      authorized_users() {
        if (Array.isArray(this.login_user_info?.authorized_users)) {
          return this.login_user_info.authorized_users.map(item => {
            item.text = `切换到用户【${item.authorized_user_name}】`
            return item
          })
        }
        return this.login_user_info?.authorized_users || []
      },
      login_user_info() {
        return uni.getStorageSync('login_user_info')
      },
      appSwiperList() {
        if (Array.isArray(this.appList)) {
          return this.appList.reduce((pre, item) => {
            if (pre.length === 0) {
              pre = [
                [item]
              ]
            } else if (pre[pre.length - 1].length >= 10) {
              pre.push([item])
            } else {
              pre[pre.length - 1].push(item)
            }
            return pre
          }, [])
        }
      },
      currentApp() {
        if (Array.isArray(this.appList) && this.appList.length > 0) {
          let res = this.deepClone(this.appList[this.current])
          return res
        }
      }
    },
    onLoad(option) {
      let isLogin = uni.getStorageSync('isLogin')
      if (option.code && option.state && !isLogin) {
        // 扫码登陆重定向
        this.scanLogin(option)
      } else {
        // #ifdef H5
        // this.checkUpdate()
        this.initializeList()
        // #endif
      }
    },
    methods: {
      async getHyInfo() {
        const url = '/fyzhmd/select/srvstore_member_mgmt_select'
        const req = {
          "serviceName": "srvstore_member_mgmt_select",
          "colNames": ["*"],
          "condition": [{
            "colName": "hy_user_no",
            "ruleType": "eq",
            "value": uni.getStorageSync('login_user_info').user_no
          }],
          "page": {
            "pageNo": 1,
            "rownumber": 1
          }
        }
        let res = await this.onRequest("select", 'srvstore_member_mgmt_select', req, "fyzhmd")
        if (res.data.state === 'SUCCESS') {
          let memberInfo = res.data.data
          if (memberInfo.length > 0) {
            this.hyInfo = memberInfo[0]
            uni.setStorageSync('hyInfo', memberInfo[0])
            // getStoreInfo(res.data[0].store_no)

          } else {}
        }

      },
      clickUserMenu(to, data) {
        if (!to || typeof to !== 'string') {
          return
        }
        data = data || this.preciseUserInfo
        let serviceName = ''
        let navUrl = ''
        let disabled = false
        switch (to) {
          case 'khxx': //客户信息 srvstore_member_mgmt_select
            serviceName = 'srvstore_member_mgmt_select'
            navUrl =
              `/pages/public/detail/detail?id=${data?.id}&serviceName=srvstore_member_mgmt_select`

            navUrl = `/pages/specific/khxx/khxx?hy_no=${data.hy_no}`
            break;
          case 'jksj': // 健康数据
            serviceName = 'srvstore_member_mgmt_select'
            navUrl = `/pages/public/buttonGroup/buttonGroup?hy_no=${data?.hy_no}`
            // navUrl = `/pages/public/list/list?pageType=list&store_no=ST2106070002&serviceName=srvstore_member_mgmt_select`
            break;
          case 'pcbg': // 评测报告 srvstore_evaluation_report_select
            serviceName = 'srvstore_evaluation_report_select'
            break;
          case 'jkfa': // 健康方案 srvfyzh_health_programme_select
            serviceName = 'srvfyzh_health_programme_select'
            disabled = true
            break;
          case 'gyjl': // 干预记录 srvfyzh_health_tonning_record_select
            serviceName = 'srvfyzh_health_tonning_record_select'
            break;
          case 'hfjl': // 回访记录 srvstore_visit_to_record_select
            serviceName = 'srvstore_visit_to_record_select'
            break;
          case 'tzsy': // 投资损益 srvfyzh_health_programme_select
            serviceName = 'srvfyzh_health_programme_select'
            navUrl = `/pages/specific/tzsy/tzsy?hy_no=${data?.hy_no}`
            break;
          case 'tlxg': // 调理效果 srvfyzh_health_tonning_record_select
            serviceName = 'srvfyzh_health_tonning_record_select'
            navUrl = `/pages/specific/tlxg/tlxg?hy_no=${data?.hy_no}`
            break;

        }
        let cond = [{
          colName: "hy_no",
          ruleType: 'eq',
          value: data?.hy_no
        }]
        if(navUrl){
          if(navUrl.indexOf('?')==-1){
            navUrl+=`?ignoreStoreNo=true`
          }else{
            navUrl+=`&ignoreStoreNo=true`
          }
        }
        // cond = []
        if (serviceName) {
          if (navUrl) {
            uni.navigateTo({
              url: navUrl
            })
            return
          }
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&ignoreStoreNo=true&serviceName=${serviceName}&cond=${JSON.stringify(cond)}`
          });
        }

      },
      onSearch(keywords) {
        // 精确搜索用户
        this.getUserInfo(keywords)
      },
      clearKeywords() {
        this.preciseUserInfoList = []
        this.preciseUserInfo = null
      },
      async getUserInfo(keywords) {
        let serviceName = 'srvstore_member_this_month_data_select'
        // serviceName = 'srvstore_member_mgmt_select'
        let bxRequest = {
          "serviceName": serviceName,
          "colNames": [
            "hy_profile_url", "reviewNum", "interveneNum", "nutrilite_tube_division", "customer_tag", "phone",
            "hy_name", "hy_no"
          ],
          "condition": [{
              "colName": "store_no",
              "ruleType": "eq",
              "value": this.storeNo
            },
            {
              "colName": "phone",
              "ruleType": "eq",
              "value": keywords
            }
          ],
          "page": {
            "pageNo": 1,
            "rownumber": 5
          },
        }

        let userInfo = uni.getStorageSync('login_user_info')
        if (userInfo && Array.isArray(userInfo.roles) && userInfo.roles.includes('fyzh_mgr')) {
          bxRequest.condition[0].value = ''
        }

        let res = await this.onRequest("select", serviceName, bxRequest, "fyzhmd")
        if (res.data.state === 'SUCCESS' && res.data.data.length > 0) {
          this.preciseUserInfo = res.data.data[0]
          this.preciseUserInfoList = res.data.data
        } else {
          this.preciseUserInfo = null
          this.preciseUserInfoList = []
        }
      },
      async scanLogin(e) {
        const {
          code,
          state
        } = e
        let data = {};
        data["code"] = code;
        data["state"] = state;
        var request = {};
        request.serviceName = "srvwx_web_scan_auth";
        request.data = [];
        request.data.push(data);
        var bxRequest = [];
        bxRequest.push(request);
        console.log('scanLogin', e)
        let res = await this.onRequest("operate", "srvwx_web_scan_auth", bxRequest, "wx")
        if (res.data.state === 'SUCCESS') {
          var resp = res.data.response[0];
          var bx_auth_ticket = resp.response.bx_auth_ticket;
          console.log('scanLogin-resp', resp)
          var current_login_user = resp.response.login_user_info;
          uni.setStorageSync("bx_auth_ticket", bx_auth_ticket);
          uni.setStorageSync("isLogin", true);
          uni.setStorageSync("login_user_info", current_login_user);
          top.user = current_login_user;
          if (resp.response?.expire_time) {
            let expire_timestamp = parseInt(new Date().getTime() / 1000) +
              resp.response.expire_time; //过期时间的时间戳(秒)
            uni.setStorageSync('expire_time', resp.response.expire_time); // 有效时间
            uni.setStorageSync('expire_timestamp', expire_timestamp); // 过期时间
          }
          uni.reLaunch({
            url: '/pages/home/home'
          })
        }
      },
      //跳转list页面
      clickMenu(e) {
        if (!e) {
          return
        }
        let url = ''
        if (e === '/web_site/bxdaq_cms_content/') {
          // 内容管理
          // uni.navigateTo({
          //   url: `/pages/public/list/list?destApp=daq&pageType=list&serviceName=` + "srvdaq_cms_content_select"
          // });
        } else if (e === 'srvstore_member_mgmt_add') {
          // 创建用户
          // storeNo
          url =
            `/pages/public/formPage/formPage?serviceName=${e}&type=add&destApp=&cond=[{"colName":"store_no","ruleType":"like","value":"${this.storeNo}"}]`
          uni.navigateTo({
            url
          })
        } else if (e === 'srvfyzh_health_medicine_accurately_select') {
          // 用药划价
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvstore_evaluation_report_select") {
          // 评测报告
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvstore_visit_to_record_select") {
          // 顾客回访
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (
          'srvstore_quality_measurement_select,srvstore_health_body_exam_select,srvstore_health_user_blood_sugar_select,srvstore_health_user_blood_pressure_select'
          .indexOf(e) !== -1) {
          // 体制测量,风险评估,血糖、血压
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvstore_shop_mgmt_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
          // /bxstore_member/bxstore_member_mgmt/
        } else if (e === "srvstore_shop_staff_role_mgmt_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvstore_member_mgmt_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&store_no=${ this.personage.store_no}&serviceName=${e}&detailDisabled=true`
          });
        } else if (e === "srvstore_health_body_exam_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvfyzh_health_programme_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}&detailDisabled=true`
          });
        } else if (e === "srvfyzh_health_tonning_record_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else if (e === "srvstore_health_equipment_management_select") {
          uni.navigateTo({
            url: `/pages/public/list/list?pageType=list&serviceName=${e}`
          });
        } else {
          uni.navigateTo({
            url: e,
            fail() {
              if (e.indexOf('http')) {
                uni.navigateTo({
                  url: '/pages/public/webView/webView?webUrl=' + encodeURIComponent(e)
                })
              }
            }
          })
        }

      },
      //切换店铺
      confirmSwitchShop(user) {
        // console.log(user.id)
        this.showSwitchShop = false
        this.isPresent = user.id
        let list = this.storelist
        let _this = this
        uni.showToast({
          title: '正在切换' + user.store_name,
          icon: 'none',
          success() {
            _this.initializeList(user.id)
          }
        })
      },
      // 左上角点击事件
      actionSheet() {
        this.showSwitchShop = true
      },
      // 请求菜单
      headerSyscore() {
        let url = this.$api.serverURL + '/fyzhmd/select/srvsys_user_menu_select'
        let req = {
          "serviceName": "srvsys_user_menu_select",
          "colNames": ["*"],
          "condition": [{
            "colName": "client_type",
            "ruleType": "like",
            "value": "PC"
          }],
          "order": [{
            "colName": "seq",
            "orderType": "asc"
          }]
        }
        this.$http.post(url, req).then(res => {
          if (res.data.state == "SUCCESS") {
            let list = res.data.data
            console.log(list)
            // this.syslist = list
            let syslist = []
            let health = []
            let userManageMenus = []
            for (let i = 0; i < list.length; i++) {
              if (['/web_site/bxdaq_cms_content/', '/bxstore_member/bxstore_shop_mgmt/',
                  '/bxstore_member/bxstore_shop_staff_role_mgmt/'
                ].includes(list[i].path)) {
                // 店铺管理按钮
                syslist.push(list[i])
              } else if (['/bxstore_health/bxfyzh_health_tonning_record/',
                  '/bxstore_health/bxstore_evaluation_report/', '/bxstore_health/bxstore_visit_to_record/',
                  '/bxstore_health/bxfyzh_health_programme/'
                ].includes(list[i].path)) {
                // '/bxstore_health/bxstore_health_body_exam/', 
                // 健康管理按钮
                health.push(list[i])
              }
              // if (['/bxstore_member/bxstore_member_mgmt/'].includes(list[i].path)) {
              //   // userManageMenus 用户管理
              //   userManageMenus.push(list[i])
              // }
              // if (list[i].path == '/bxstore_member/bxstore_shop_mgmt/') {
              // 	syslist.push(list[i])
              // } else if (list[i].path == '/bxstore_member/bxstore_shop_staff_role_mgmt/') {
              // 	syslist.push(list[i])
              // } else if (list[i].path == '/bxstore_member/bxstore_member_mgmt/') {
              // 	syslist.push(list[i])
              // } else if (list[i].path == '/bxstore_health/bxfyzh_health_tonning_record/') {
              // 	health.push(list[i])
              // } else if (list[i].path == '/bxstore_health/bxstore_health_body_exam/') {
              // 	health.push(list[i])
              // } else if (list[i].path == '/bxstore_health/bxfyzh_health_programme/') {
              // 	health.push(list[i])
              // }
            }
            syslist.push({
              "menu_no": "bxdaq_cms_content",
              "menu_url": "/vpages/index.html#/list/srvdaq_cms_content_select",
              "client_type": "PC,APP",
              "parent_no": "web_site",
              "path": "/web_site/bxdaq_cms_content/",
              "menu_name": "内容管理"
            })
            // userManageMenus.unshift({
            //   "client_type": "PC,APP",
            //   "parent_no": "web_site",
            //   "path": "/add_user/",
            //   "menu_name": "新增用户"
            // })
            // this.userManageMenus = userManageMenus
            this.syslist = syslist
            this.healthList = health
          }
        })
      },
      initializeList(id) {
        // this.headerSyscore()
        const urls = this.$api.serverURL + '/fyzhmd/select/srvstore_shop_mgmt_select'
        const reqs = {
          "serviceName": "srvstore_shop_mgmt_select",
          "colNames": ["*"],
          "condition": [],
          "draft": false,
          "order": [],
          "page": {
            "pageNo": 1,
            "rownumber": 10
          },
          "query_source": "list_page",
          "relation_condition": {}
        }
        this.$http.post(urls, reqs).then((res) => {
          if (res.data.data.length > 0) {
            this.storelist = res.data.data
            const url = this.$api.serverURL + '/fyzhmd/select/srvstore_shop_mgmt_select'
            const req = {
              "serviceName": "srvstore_shop_mgmt_select",
              "colNames": ["*"],
              "condition": [{
                "colName": "id",
                "ruleType": "eq",
                "value": id ? id : res.data.data[0].id
              }],
              "draft": false,
              // hisVer: false
              "query_source": "list_page",
              "page": {
                "pageNo": 1,
                "rownumber": 10
              }
            }
            this.$http.post(url, req).then(res => {
              // console.log(res.data.data[0])
              this.personage = res.data.data[0]
              // console.log(res.data.data[0].store_no)
              this.storeNo = res.data.data[0].store_no
              sessionStorage.setItem("storeNo", res.data.data[0].store_no)
              this.getMember(res.data.data[0].store_no)
              this.getfitness(res.data.data[0].store_no)
              this.getregulate(res.data.data[0].store_no)
              this.getimplement(res.data.data[0].store_no)
              this.getHyInfo()
            })
          } else {
            this.ErrShow = true
          }
        })

      },
      //获取门店服务
      getimplement(store_no) {
        const url = this.$api.serverURL + '/fyzhmd/select/srvfyzh_health_tonning_record_select'
        const req = {
          "serviceName": "srvfyzh_health_tonning_record_select",
          "colNames": ["*"],
          "condition": [{
            colName: "store_no",
            ruleType: "eq",
            value: store_no
          }],
          draft: false,
          page: {
            pageNo: 1,
            rownumber: 5
          },
          query_source: "list_page"
        }
        this.$http.post(url, req).then(res => {
          this.implementNum = res.data?.page?.total || 0
        })
      },
      // 获取调理方案
      getregulate(store_no) {
        const url = this.$api.serverURL + '/fyzhmd/select/srvfyzh_health_programme_select'
        const req = {
          "serviceName": "srvfyzh_health_programme_select",
          "colNames": ["*"],
          "condition": [{
            colName: "store_no",
            ruleType: "like",
            value: store_no
          }],
          draft: false,
          page: {
            pageNo: 1,
            rownumber: 1000
          },
          query_source: "list_page"
        }
        this.$http.post(url, req).then(res => {
          // console.log(res.data.data)
          this.regulateNum = res.data.page.total
          let list = res.data.data
          console.log(list)
          let arr = []
          arr = list.map(item => Number(item["money_real_pay"]))
          var sum = 0
          for (var i = 0; i < arr.length; i++) {
            sum = sum + arr[i] || 0
          }
          this.topay = sum
        })
      },

      //获取健康评测
      getfitness(store_no) {
        const url = this.$api.serverURL + '/fyzhmd/select/srvstore_health_body_exam_select'
        const req = {
          "serviceName": "srvstore_health_body_exam_select",
          "colNames": ["*"],
          "condition": [{
            colName: "store_no",
            ruleType: "like",
            value: store_no
          }],
          draft: false,
          page: {
            pageNo: 1,
            rownumber: 5
          },
          query_source: "list_page"
        }
        this.$http.post(url, req).then(res => {
          this.fitnessNum = res.data.page?.total || 0
        })
      },
      //获取会员
      getMember(store_no) {
        const url = this.$api.serverURL + '/fyzhmd/select/srvstore_member_mgmt_select'
        const req = {
          "serviceName": "srvstore_member_mgmt_select",
          "colNames": ["*"],
          "condition": [{
            colName: "store_no",
            ruleType: "eq",
            value: store_no
          }],
          draft: false,
          page: {
            pageNo: 1,
            rownumber: 5
          },
          query_source: "list_page"
        }
        this.$http.post(url, req).then(res => {
          this.member = res.data?.page?.total || 0
        })
      },

      checkUpdate() {
        const url = this.$api.serverURL + '/config/select/srvconfig_app_version_select'
        const req = {
          "serviceName": "srvconfig_app_version_select",
          "colNames": ["*"],
          "condition": [{
            colName: "app_no",
            ruleType: 'eq',
            value: "fyzhmd"
          }],
          "page": {
            "pageNo": 1,
            "rownumber": 1
          },
          "order": [{
            "colName": "create_time",
            "orderType": "desc"
          }],
        }
        this.$http.post(url, req).then(res => {
          if (Array.isArray(res.data.data) && res.data.data.length > 0) {
            const appVersion = res.data.data[0]
            if (appVersion && appVersion.version_no !== this.versionNo) {
              // if(appVersion.upgrade_type=='是'){

              // }else if(appVersion.upgrade_type==='强制升级'){

              // }
              if (Array.isArray(appVersion?._app_file_no_disp) && appVersion._app_file_no_disp
                .length > 0) {
                const src = this.$api.getFilePath + appVersion._app_file_no_disp[0].fileurl
                uni.showModal({
                  title: '升级提示',
                  content: '检测到APP有新的版本，是否进行更新',
                  showCancel: appVersion.upgrade_type !== '强制升级',
                  success: (res) => {
                    if (res.confirm) {
                      var iframe = document.createElement('iframe');
                      iframe.style.display = 'none';
                      iframe.src = "javascript: '<script>location.href=\"" +
                        src + "\"<\/script>'";
                      document.getElementsByTagName('body')[0].appendChild(
                        iframe);
                    }
                  }
                })
              }

            }
            // this.initializeList(appVersion.id)
          }
        })
      },
      confirmSwitchUser(user) {
        if (user.authorized_user) {
          this.showSwitchUser = false
          uni.showModal({
            title: '是否切换账号？',
            content: `目标账号:${user.authorized_user_name||''}`,
            success: (res) => {
              if (res.confirm) {
                this.switchUser(user.authorized_user)
              } else {
                this.showSwitchUser = true
              }
            }
          })
        }
      },
      confirmHotReload(appName, title) {
        if (!appName) {
          return
        }
        this.showHandlerPopup = false
        uni.showModal({
          title: '是否进行热加载？',
          content: `目标应用:${title||appName}`,
          success: (res) => {
            if (res.confirm) {
              this.hotReload(appName)
            } else {
              this.showHandlerPopup = true
            }
          }
        })
      },
      async hotReload(appName) {
        // 热加载/同步内存
        const app = appName || this.appList[this.current] || uni.getStorageSync('activeApp')
        if (app) {
          let req = [{
            "serviceName": "srvsys_hot_reload_data"
          }]
          let res = await this.onRequest("operate", "srvsys_hot_reload_data", req, app)
          if (res.data.resultMessage) {
            uni.showToast({
              title: res.data.resultMessage,
              icon: 'none'
            })
          }

        }
      },
      async switchUser(user) {
        const req = [{
          "serviceName": "srvuser_login_account_switch",
          "data": [{
            "authorized_user": user
          }]
        }]
        let res = await this.onRequest("operate", "srvuser_login_account_switch", req, 'sso')
        if (res.data.state === "SUCCESS") {
          if (Array.isArray(res.data.response) && res.data.response.length > 0) {
            let result = res.data.response[0]
            if (result.response) {
              const response = result.response
              uni.clearStorage()
              let expire_timestamp = parseInt(new Date().getTime() / 1000) + response
                .expire_time; //过期时间的时间戳(秒)
              uni.setStorageSync('bx_auth_ticket', response.bx_auth_ticket);
              uni.setStorageSync('expire_time', response.expire_time); // 有效时间
              uni.setStorageSync('expire_timestamp', expire_timestamp); // 过期时间
              if (response.login_user_info.user_no) {
                uni.setStorageSync('login_user_info', response.login_user_info);
              }
              uni.setStorageSync('isLogin', true);
              uni.reLaunch({
                url: '/pages/home/home'
              })
            }
          }
        }
      },
      clickAction(index) {
        let list = [...this.actionList, ...this.authorized_users]
        if (list.length > index) {
          const current = list[index]
          switch (current.text) {
            case '热加载':
            case '同步内存':
              this.showHandlerPopup = true;
              break;
            case '刷新页面':
              window.location.reload()
              break;
            case '切换用户':
              this.showSwitchUser = true
              break;
            case '修改密码':
              uni.navigateTo({
                url: '/pages/public/changePwd/changePwd'
              })
              break;
            case '退出登录':
              uni.clearStorageSync()
              uni.reLaunch({
                url: '/pages/public/accountExec/accountExec'
              })
              break;
          }
          // if (current.authorized_user) {
          // 	this.switchUser(current.authorized_user)
          // }
        }
      },
      clickApp(e, index) {
        this.showMenu = false
        uni.setStorageSync('activeApp', e.name)
        this.current = index
        this.menuList = e.menus
        this.showMenu = true
        // if (!e.menus || !Array.isArray(e.menus) || e.menus.length === 0) {
        this.getAppMenu()
        // }
      },
      async getApps() {
        let req = {
          "serviceName": "srvauth_user_app_menu_select",
          "order": [{
            colName: "app_seq",
            orderType: 'asc'
          }],
          "colNames": ["*"]
        }
        let res = await this.onRequest("select", "srvauth_user_app_menu_select", req, "auth")
        if (res.data.state === 'SUCCESS' && res.data.data.length > 0) {
          const menus = res.data.data
          this.appList = menus.map((item, index) => {
            let a = {
              title: "",
              name: "",
              icon: "",
              seq: "",
              link: "",
              type: "button",
              menus: [],
              _childNode: []
            }
            a.title = item.app_name
            a.name = item.app_no
            a.icon = item.app_icon ? item.app_icon.trim() : null
            a.seq = item.app_seq
            a.class_no = item.class_no
            a.class_name = item.class_name
            // this.getAppMenu(item.app_no).then(res2 => {
            // 	this.$set(a, 'menus', res2)
            // 	this.$set(a, '_childNode', res2)
            // })
            // if (index === this.current) {
            // 	uni.setStorageSync('activeApp', item.app_no)
            // }
            let app = uni.getStorageSync('activeApp')
            if (app && a.name === app) {
              this.current = index
            }
            return a
          })
          let app = uni.getStorageSync('activeApp')
          if (!app && this.appList.length > 0) {
            app = this.appList[0].name
            uni.setStorageSync('activeApp', app)
          }
          this.getAppMenu()
          // if(this.currentApp?.name){
          // 	this.getAppMenu(this.currentApp.name).then(res2 => {
          // 		let current  =  this.appList[this.current]
          // 		current.menus = res2
          // 		current._childNode = res2
          // 		this.$set(this.appList, this.current, current)
          // 	})
          // }
        }
        console.log("appmenu2", this.appMenu)
      },
      async getAppMenu(app) {
        app = app || this.currentApp?.name
        if (!app) {
          return
        }
        let req = {
          "serviceName": "srvsys_user_menu_select",
          "colNames": ["*"],
          // "condition": [{
          // 	colName: "client_type",
          // 	ruleType: "like",
          // 	value: "APP"
          // }],
          "order": [{
            "colName": "seq",
            "orderType": "asc"
          }]
        }
        let url = this.$api.serverURL + `/${app}/select/srvsys_user_menu_select`
        return this.$http.post(url, req).then((res) => {
          let datas = this.treeReform(res.data.data, 'parent_no', 'menu_no')
          this.menuList = datas
          let current = this.appList[this.current]
          current.menus = datas
          current._childNode = datas
          this.$set(this.appList, this.current, current)
          return datas
        })
      },
    },
    mounted() {
      // uni.setNavigationBarTitle({
      // 	title: this.title
      // })

    },
    created() {
      localStorage.setItem("activeApp", "fyzhmd")
      // this.getApps()
    }
  }
</script>

<style lang="scss" scoped>
  .page-wrap {
    background-color: #F8F8FA;
    min-height: calc(100vh - var(--window-bottom));
    padding-bottom: 10px;

    .top-handler {
      overflow: hidden;
      display: flex;
      width: 100%;
      justify-content: space-between;
      padding: 10rpx 20rpx;
      // color: #fff;
      // color: #0081ff;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      letter-spacing: 1px;
      font-weight: bold;

      .handler_image {
        display: flex;

        .top_imgon {
          line-height: 40rpx;
          // image {
          // 	width: 24px;
          // 	height: 24px;
          // }
        }

        .top_img {
          // margin-left: 8px;
          // line-height: 17px;
          line-height: 40rpx;
          // image {
          // 	width: 7px;
          // 	height: 4px;
          // }
        }
      }


      .handler {
        // font-family: '楷体';
      }

      .user-menu {
        max-width: 250rpx;
        padding: 0 10rpx 0 20rpx;
      }
    }

    .content_All {
      width: 90%;
      margin: 0 auto;

      .message {
        width: 100%;
        // height: 120px;
        margin: 8px auto;
        border-radius: 8px;
        background: #FFFFFF;
        // padding-top: 8px;
        padding: 20rpx;

        .message_hander {
          width: 90%;
          // height: 44px;
          padding: 20rpx;
          margin: 0 auto;
          background: #F8F8FA;
          display: flex;
          justify-content: space-between;
          border-radius: 22px;
          // padding: 8px;

          .message_left {
            display: flex;
            line-height: 56rpx;
            color: #333333;
            font-size: 32rpx;

            image {
              width: 56rpx;
              height: 56rpx;
              border-radius: 50%;
              margin-right: 10px;
            }
          }

          .message_right {
            // width: 144px;
            // height: 28px;
            background: #FFFFFF;
            border-radius: 22px;
            display: flex;
            justify-content: center;
            line-height: 50rpx;
            // padding: 5rpx;
            padding: 0 20rpx;

            .message_cut {
              color: #ADAEBB;
              margin-right: 5px;
              font-size: 22rpx;
            }

            .message_xright {
              margin-right: 5rpx;

              image {
                width: 26rpx;
                height: 26rpx;
                margin-right: 10rpx;
              }

              // font-weight: bold;
            }
          }
        }

      }

      .classify {
        margin-top: 5px;
        display: flex;
        justify-content: space-between;

        .classify_item {
          // padding-top: 12px;
          // padding-left: 8px;
          padding: 20rpx;
          width: 20%;
          flex: 1;
          margin-right: 20rpx;
          // height: 104px;
          background: #FFFFFF;
          border-radius: 12px;
          text-align: center;

          &:last-child {
            margin-right: 0;
          }

          image {
            width: 50rpx;
            height: 50rpx;
          }

          .classify_num {
            // margin-top: 10rpx;
            // margin-left: 5px;
            font-weight: bold;
            // font-size: 18px;
            font-size: 30rpx;
          }

          .classify_amount {
            margin-top: 5px;
            font-size: 22rpx;
            // margin-left: 5px;
            color: #9092A5;
          }
        }
      }

    }

    .shopmanage {
      width: 100%;
      padding: 24rpx 20rpx;
      background: #FFFFFF;
      border-radius: 8px;
      margin-top: 12px;

      .shop_name {
        font-size: 30rpx;
        color: #333333;
        font-weight: bold;
      }

      .shop_content:after {
        content: "";
        width: 25%;
        height: 0;
        visibility: hidden;
      }

      .shop_content {
        width: 100%;
        padding: 0px 30rpx;
        border-radius: 8px;
        margin-top: 12px;
        background: #FAFBFC;
        display: flex;
        flex-wrap: wrap;
        text-align: center;

        image {
          width: 40px;
          height: 40px;
        }

        .shop_item {
          margin-top: 13px;
          width: 25%;
          text-align: center;

          .image {
            width: 40px;
            height: 40px;
            font-size: 30px;
            border-radius: 5px;
            text-align: center;
            line-height: 40px;
            margin: 0 auto;
            background-color: #F1F1F1;
          }

          .item_name {
            color: #9092A5;
            margin-top: 2px;
          }
        }
      }
    }

    .investment {
      width: 100%;
      padding: 24rpx 20rpx;
      background: #FFFFFF;
      border-radius: 8px;
      margin-top: 12px;
      font-size: 30rpx;
      color: #333333;
      font-weight: bold;
      display: flex;
      // justify-content: space-between;
    }

    .fitness {
      width: 100%;
      padding: 24rpx 20rpx;
      background: #FFFFFF;
      border-radius: 8px;
      margin-top: 12px;

      .shop_name {
        font-size: 30rpx;
        color: #333333;
        font-weight: bold;
      }

      .shop_content:after {
        content: "";
        width: 25%;
        height: 0;
        visibility: hidden;
      }

      .shop_content {
        width: 100%;
        padding: 0px 16px;
        border-radius: 8px;
        margin-top: 12px;
        background: #FAFBFC;
        display: flex;
        flex-wrap: wrap;

        image {
          width: 40px;
          height: 40px;
          border-radius: 5px;
          background-color: #F1F1F1;
        }

        .shop_item {
          margin-top: 13px;
          width: 25%;
          text-align: center;

          .item_name {
            color: #9092A5;
            margin-top: 2px;
          }
        }
      }
    }

    .swiper {
      height: 420rpx;
    }

  }

  .app-list {
    display: flex;
    flex-wrap: wrap;
    padding: 10rpx;

    .app-item {
      width: 20%;
      text-align: center;
      padding: 10rpx;
      border-radius: 20rpx;

      &.long {
        width: calc(50% - 10rpx);
      }

      &.current {
        color: #0081ff;
        border: 1px solid;
        font-weight: bold;
        border-color: rgba($color: #0081ff, $alpha: 0.1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);

        .icon {
          height: 118rpx;
        }
      }

      .icon {
        margin: auto;
        padding: 15rpx;
        width: 120rpx;
        height: 120rpx;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        border-radius: 20rpx;
        margin-bottom: 10rpx;

        // background: #1488CC;  /* fallback for old browsers */
        .image {
          width: 100%;
          height: 100%;
        }

        .text {
          // font-weight: bold;
          font-size: 32rpx;
          width: 50%;
        }
      }
    }
  }

  .menu-list {
    border-top: 1px solid #f1f1f1;
    padding-top: 20rpx;
    // .menu-item {
    // 	padding: 20rpx;
    // 	border-bottom: 1rpx solid #f1f1f1;
    // }
  }

  .head-handler-popup {
    padding: 20rpx;

    .tips {
      font-weight: bold;
      text-align: center;
      padding-bottom: 20rpx;

      .text-normal {
        font-weight: normal;
      }
    }

    .app-list {
      padding: 0;
    }

    .app-item {
      min-width: calc(25% - 30rpx/4);
      margin-right: 10rpx;
      margin-bottom: 10rpx;

      &:nth-child(4n) {
        margin-right: 0;
      }
    }
  }

  .shopList {
    text-align: center;
    align-items: center;
    margin: 26upx auto;
    font-size: 30upx;
    border: none;
    background: none;
  }

  .present {
    // color: red;
    background: #E5F3FF;
    color: #0088FE;
  }

  .user-menu-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;

    .cu-btn {
      min-width: 23%;
      margin-top: 5px;
    }
  }

  .user-info-box {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;

    &:last-child {
      border-bottom: none;
    }

    .user-image {
      width: 60px;
      height: 60px;

      .image {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        overflow: hidden;
      }

      margin-right: 10px;
      border-radius: 50%;
      background-color: #F1F1F1;
    }

    .user-info {
      flex: 1;
      display: flex;
      flex-wrap: wrap;

      .form-item {
        min-width: 50%;
        display: flex;
        // justify-content: space-between;
        margin-bottom: 5px;

        .label {
          margin-right: 10px;
        }
      }
    }
  }
</style>
